package com.magic.cd.core;

import java.net.InetAddress;
import java.net.Socket;

/**
 * 构建一个Socket客户端
 * */
public class MySocket {
	private String host;
	private int port;
	
	public MySocket(String host,int port){
		this.host = host;
		this.port = port;
	}
	
	/**
	 * 获取一个Socket客户端
	 * */
	public Socket connect(){
		try {
			return new Socket(InetAddress.getByName(host),port);
		} catch (Exception e) {
			throw new RuntimeException(e);
		} 
	}
}
